﻿using System.Collections.Specialized;
using Xoohoo.Configuration;

namespace Xoohoo.Configuration.Extensions
{
    public static class XoohooSettingConfigurationElementCollectionExtensions
    {
        public static NameValueCollection ToNameValueCollection(this XoohooSettingConfigurationElementCollection settings)
        {
            NameValueCollection nvm = new NameValueCollection(settings.Count);

            foreach (XoohooSettingConfigurationElement setting in settings)
                nvm.Add(setting.Name, setting.Value);

            return nvm;
        }
    }
}
